///////////////////////////////////////////////////////////////////////////////
//
//  Elfin
//  Kolonitsky Developers Alliance (c) 2012
//  All rights received
//
///////////////////////////////////////////////////////////////////////////////
package org.kolonitsky.alexey.utils
{
    public class ObjectSet
    {
        public static function union (a:Object, b:Object, substitute:Boolean = false):Object
        {
            var result:Object = {};
            for (var p:String in a)
                result[p] = a[p];

            for (p in b)
            {
                if (p in result && !substitute)
                    continue
                result[p] = b[p];
            }
            return result;
        }
    }
}
